import BetterUtilTools from 'better-util-tools';
const UtilTools = new BetterUtilTools();
const utils = {
    getCurPage() {
        let pages = getCurrentPages();
        let page = pages[pages.length - 1];
        return page;
    },
    showLoading(opts={}) {
        return uni.showLoading(...opts);
    },
    hideLoading() {
        uni.hideLoading();
    },
    showToast(opts={}) {
        uni.showToast(UtilTools.extend({
            'icon': 'none',
            'duration': 2000,
            'title': '请求失败'
        }, opts));
    }
};

export default utils;
